#pragma once
#include <math.h>
#include "Util.h"

class Matrix
{
public:
	float m[4][4];
public:

	Matrix(void);
	Matrix(Matrix*);
	Matrix(float* arr);
	~Matrix(void);
	

	void CreateViewMatrix(
		float xPos = 0.0, float yPos = 0.0, float zPos = 0.0);
	void CreateFrutum(float xLeft, float xRight, float yBottom, float yTop, float zNear, float zFar);
	void Perspective(float fovy, float aspect, float nearZ, float farZ);
	void LoadIdentity();
	void MatrixMultiply(Matrix *matrixA, Matrix *matrixB);
	void MatrixSubtraction(Matrix *matrixA, Matrix *matrixB);
	void MatrixSum(Matrix *matrixA, Matrix *matrixB);
	void Transpose();
	void RotateX(float angle);
	void RotateY(float angle);
	void RotateZ(float angle);
	void Copy(Matrix *src);
    void Ortho(float left, float right, float top, float bottom, float near, float far);
	// rotate by cos(anpha)
	void Rotate(float angle, float x, float y, float z);

	float GetValue(int row, int col);

	void Translate(float x, float y, float z);
	void Scale(float x, float y, float z);
	float* ToArray();
	float* GetM(){return &m[0][0];}
	Matrix* GetInvert();
	
};
